#pragma once
#include <allegro5\allegro_color.h>
#include "GFuns.h"

class Color{
public:
	ALLEGRO_COLOR white;
	ALLEGRO_COLOR black;
	ALLEGRO_COLOR mpink;
	ALLEGRO_COLOR blank;
	ALLEGRO_COLOR shadow;
	ALLEGRO_COLOR shadowL;
	ALLEGRO_COLOR shadowLL;
	ALLEGRO_COLOR shadowLLL;

	ALLEGRO_COLOR water;
	ALLEGRO_COLOR waterD;
	ALLEGRO_COLOR waterL;
	ALLEGRO_COLOR waterLL;
	ALLEGRO_COLOR sandD;
	ALLEGRO_COLOR sand;
	ALLEGRO_COLOR sandL;
	ALLEGRO_COLOR grass;
	ALLEGRO_COLOR grassD;
	ALLEGRO_COLOR grassL;
	ALLEGRO_COLOR taiga;
	ALLEGRO_COLOR tundra;
	ALLEGRO_COLOR tundraD;
	ALLEGRO_COLOR snow;
	ALLEGRO_COLOR snowL;
	ALLEGRO_COLOR snowD;
	ALLEGRO_COLOR snowDD;

	ALLEGRO_COLOR ground;
	ALLEGRO_COLOR groundL;
	ALLEGRO_COLOR groundD;
	ALLEGRO_COLOR bridge;
	ALLEGRO_COLOR bridgeD;
	ALLEGRO_COLOR bridgeL;
	ALLEGRO_COLOR bridgeLL;
	ALLEGRO_COLOR metal;
	ALLEGRO_COLOR metalD;
	ALLEGRO_COLOR metalDD;
	ALLEGRO_COLOR tree;
	ALLEGRO_COLOR treeL;
	ALLEGRO_COLOR treeD;
	ALLEGRO_COLOR treeDD;
	ALLEGRO_COLOR leaf;
	ALLEGRO_COLOR leafL;
	ALLEGRO_COLOR leafD;
	ALLEGRO_COLOR leafDD;
	ALLEGRO_COLOR banana;
	ALLEGRO_COLOR bananaDD;
	ALLEGRO_COLOR mountainGoldDD;
	ALLEGRO_COLOR mountainGoldD;
	ALLEGRO_COLOR mountainGold;
	ALLEGRO_COLOR mountainGoldL;
	ALLEGRO_COLOR mountainGoldLL;
	ALLEGRO_COLOR mountainDD;
	ALLEGRO_COLOR mountainD;
	ALLEGRO_COLOR mountain;
	ALLEGRO_COLOR mountainL;
	ALLEGRO_COLOR mountainLL;
	ALLEGRO_COLOR road;
	ALLEGRO_COLOR roadD;
	ALLEGRO_COLOR roadDD;
	ALLEGRO_COLOR houseB;
	ALLEGRO_COLOR roof;
	ALLEGRO_COLOR roofL;
	ALLEGRO_COLOR roofD;
	ALLEGRO_COLOR roofDD;
	ALLEGRO_COLOR stone;
	ALLEGRO_COLOR stoneL;
	ALLEGRO_COLOR stoneD;
	ALLEGRO_COLOR doors;
	ALLEGRO_COLOR doorsD;

	ALLEGRO_COLOR carpet;
	ALLEGRO_COLOR carpetL;
	ALLEGRO_COLOR carpetD;
	ALLEGRO_COLOR gold;
	ALLEGRO_COLOR pavement;
	ALLEGRO_COLOR pavementL;
	ALLEGRO_COLOR pavementD;
	ALLEGRO_COLOR pavementDD;
	ALLEGRO_COLOR pillow;
	ALLEGRO_COLOR pillowL;
	ALLEGRO_COLOR pillowD;
	ALLEGRO_COLOR pillowDD;
	ALLEGRO_COLOR iron;
	ALLEGRO_COLOR ironL;
	ALLEGRO_COLOR ironD;
	ALLEGRO_COLOR ironDD;
	ALLEGRO_COLOR wood;
	ALLEGRO_COLOR woodL;
	ALLEGRO_COLOR woodD;
	ALLEGRO_COLOR woodDD;
	ALLEGRO_COLOR clothLL;
	ALLEGRO_COLOR clothL;
	ALLEGRO_COLOR cloth;
	ALLEGRO_COLOR clothD;
	ALLEGRO_COLOR clothDD;

	ALLEGRO_COLOR skinWhite;
	ALLEGRO_COLOR skinWhiteL;
	ALLEGRO_COLOR skinWhiteD;
	ALLEGRO_COLOR skinBlack;
	ALLEGRO_COLOR skinBlackL;
	ALLEGRO_COLOR skinBlackD;
	ALLEGRO_COLOR skinNord;
	ALLEGRO_COLOR skinNordL;
	ALLEGRO_COLOR skinNordD;

	ALLEGRO_COLOR Cpurple;
	ALLEGRO_COLOR CpurpleD;
	ALLEGRO_COLOR Cgold;
	ALLEGRO_COLOR CgoldD;
	ALLEGRO_COLOR Cleather;
	ALLEGRO_COLOR CleatherD;
	ALLEGRO_COLOR Clenium;
	ALLEGRO_COLOR CleniumD;
	ALLEGRO_COLOR Cgreen;
	ALLEGRO_COLOR CgreenD;
	ALLEGRO_COLOR Cred;
	ALLEGRO_COLOR CredD;
	ALLEGRO_COLOR Cblue;
	ALLEGRO_COLOR CblueD;
	ALLEGRO_COLOR Cblack;
	ALLEGRO_COLOR CblackD;
	ALLEGRO_COLOR Cbrown;
	ALLEGRO_COLOR CbrownD;
	ALLEGRO_COLOR Cpink;
	ALLEGRO_COLOR CpinkD;

	ALLEGRO_COLOR Hblonde;
	ALLEGRO_COLOR HblondeD;
	ALLEGRO_COLOR Hbrown;
	ALLEGRO_COLOR HbrownD;
	ALLEGRO_COLOR Hred;
	ALLEGRO_COLOR HredD;
	ALLEGRO_COLOR Hdark;
	ALLEGRO_COLOR HdarkD;
	ALLEGRO_COLOR Hwhite;
	ALLEGRO_COLOR HwhiteD;

	ALLEGRO_COLOR lightning;

	Color(){

		// Core
		white = al_map_rgb(255,255,255);
		black = al_map_rgb(0,0,0);
		mpink = al_map_rgb(255,0,255);
		blank = al_map_rgba(0,0,0,0);
		shadow = al_map_rgba(0,0,0,128);
		shadowL = al_map_rgba(0,0,0,64);
		shadowLL = al_map_rgba(0,0,0,32);
		shadowLLL = al_map_rgba(0,0,0,16);

		// Biomes
		water = al_map_rgb(72,176,239);
		waterD = al_map_rgb(56,152,224);
		waterL = al_map_rgb(88,192,255);
		waterLL = al_map_rgb(200,216,207);
		sandD = al_map_rgb(240,192,104);
		sand = al_map_rgb(248,216,144);
		sandL = al_map_rgb(255,236,164);
		grass = al_map_rgb(152,216,88);
		grassD = al_map_rgb(136,200,72);
		grassL = al_map_rgb(167,232,104);
		taiga = al_map_rgb(161,185,93);
		tundra = al_map_rgb(170,154,98);
		tundraD = al_map_rgb(144,120,72);
		snow = al_map_rgb(229,229,238);
		snowL = al_map_rgb(194,220,229);
		snowD = al_map_rgb(168,194,229);
		snowDD = al_map_rgb(126,149,181);

		// Terrain
		ground = al_map_rgb(152,104,32);
		groundL = al_map_rgb(176,128,48);
		groundD = al_map_rgb(128,80,16);
		bridge = al_map_rgb(136,96,64);
		bridgeD = al_map_rgb(112,72,40);
		bridgeL = al_map_rgb(176,128,80);
		bridgeLL = al_map_rgb(216,160,104);
		metal = al_map_rgb(159,177,174);
		metalD = al_map_rgb(134,151,168);
		metalDD = al_map_rgb(76,76,100);
		tree = al_map_rgb(144,120,80);
		treeL = al_map_rgb(160,136,96);
		treeD = al_map_rgb(120,112,72);
		treeDD = al_map_rgb(80,80,56);
		leaf = al_map_rgb(104,184,64);
		leafL = al_map_rgb(136,216,80);
		leafD = al_map_rgb(96,152,72);
		leafDD = al_map_rgb(72,88,64);
		banana = al_map_rgb(255,232,96);
		bananaDD = al_map_rgb(128,80,16);
		mountainGoldDD = al_map_rgb(112,72,40);
		mountainGoldD = al_map_rgb(136,96,64);
		mountainGold = al_map_rgb(176,128,80);
		mountainGoldL = al_map_rgb(216,160,104);
		mountainGoldLL = al_map_rgb(247,194,126);
		mountainDD = al_map_rgb(52,61,93);
		mountainD = al_map_rgb(114,131,148);
		mountain = al_map_rgb(134,151,168);
		mountainL = al_map_rgb(159,177,194);
		mountainLL = al_map_rgb(194,212,229);
		road = al_map_rgb(248,216,144);
		roadD = al_map_rgb(240,192,104);
		roadDD = al_map_rgb(208,152,72);

		// Cities
		houseB = al_map_rgb(100,68,44);
		roof = al_map_rgb(184,104,40);
		roofL = al_map_rgb(200,128,80);
		roofD = al_map_rgb(136,80,40);
		roofDD = al_map_rgb(96,56,32);
		stone = al_map_rgb(200,168,144);
		stoneL = al_map_rgb(248,232,208);
		stoneD = al_map_rgb(160,128,104);
		doors = al_map_rgb(187,165,123);
		doorsD = al_map_rgb(144,120,80);

		// Objects
		carpet = al_map_rgb(212,93,85);
		carpetL = al_map_rgb(229,134,101);
		carpetD = al_map_rgb(194,69,61);
		gold = al_map_rgb(247,194,126);
		pavement = al_map_rgb(185,194,204);
		pavementL = al_map_rgb(212,220,220);
		pavementD = al_map_rgb(159,177,194);
		pavementDD = al_map_rgb(129,147,164);
		pillow = al_map_rgb(229,212,168);
		pillowL = al_map_rgb(255,242,198);
		pillowD = al_map_rgb(194,177,142);
		pillowDD = al_map_rgb(138,121,79);
		iron = al_map_rgb(133,133,133);
		ironL = al_map_rgb(214,214,214);
		ironD = al_map_rgb(100,100,100);
		ironDD = al_map_rgb(66,66,66);
		wood = al_map_rgb(124,100,60);
		woodL = al_map_rgb(140,116,76);
		woodD = al_map_rgb(100,92,52);
		woodDD = al_map_rgb(60,60,36);
		cloth = al_map_rgb(159,177,194);
		clothL = al_map_rgb(194,212,229);
		clothLL = al_map_rgb(238,238,247);
		clothD = al_map_rgb(134,151,168);
		clothDD = al_map_rgb(53,61,93);

		// Skin
		skinWhite = al_map_rgb(252,194,148);
		skinWhiteL = al_map_rgb(252,210,180);
		skinWhiteD = al_map_rgb(116,66,68);
		skinBlack = al_map_rgb(156,98,76);
		skinBlackL = al_map_rgb(156,98,76);
		skinBlackD = al_map_rgb(116,42,52);
		skinNord = al_map_rgb(255,224,178);
		skinNordL = al_map_rgb(255,240,210);
		skinNordD = al_map_rgb(126,76,78);

		// Clothes
		Cpurple = al_map_rgb(80,84,120);
		CpurpleD = al_map_rgb(48,48,72);
		Cgold = al_map_rgb(208,176,24);
		CgoldD = al_map_rgb(56,56,24);
		Cleather = al_map_rgb(148,115,106);
		CleatherD = al_map_rgb(90,74,57);
		Clenium = al_map_rgb(255,255,255);
		CleniumD = al_map_rgb(106,90,82);
		Cgreen = al_map_rgb(112,184,0);
		CgreenD = al_map_rgb(16,56,0);
		Cred = al_map_rgb(224,80,96);
		CredD = al_map_rgb(96,0,24);
		Cblue = al_map_rgb(114,192,240);
		CblueD = al_map_rgb(16,48,80);
		Cblack = al_map_rgb(68,66,84);
		CblackD = al_map_rgb(4,2,4);
		Cbrown = al_map_rgb(156,98,76);
		CbrownD = al_map_rgb(68,34,44);
		Cpink = al_map_rgb(252,162,180);
		CpinkD = al_map_rgb(124,66,68);

		// Hairs
		Hblonde = al_map_rgb(238,213,98);
		HblondeD = al_map_rgb(90,74,74);
		Hbrown = al_map_rgb(139,90,57);
		HbrownD = al_map_rgb(57,41,41);
		Hred = al_map_rgb(222,123,82);
		HredD = al_map_rgb(90,65,65);
		Hdark = al_map_rgb(64,64,80);
		HdarkD = al_map_rgb(0,0,0);
		Hwhite = al_map_rgb(213,205,213);
		HwhiteD = al_map_rgb(106,98,98);

		// Weather
		lightning = al_map_rgba(200,200,255,64);
	}
	

	static ALLEGRO_COLOR mod(ALLEGRO_COLOR aCol, int aV){
		unsigned char r,g,b;
		al_unmap_rgb(aCol,&r,&g,&b);
		r = r+aV>255 ? 255 : (r+aV < 0 ? 0 : r+aV);
		g = g+aV>255 ? 255 : (g+aV < 0 ? 0 : g+aV);
		b = b+aV>255 ? 255 : (b+aV < 0 ? 0 : b+aV);
		return al_map_rgb(r,g,b);
	}

	static ALLEGRO_COLOR AddAlpha(ALLEGRO_COLOR aCol, unsigned char aAlpha)
	{
		unsigned char r,g,b;
		al_unmap_rgb(aCol,&r,&g,&b);
		return al_map_rgba(r,g,b,aAlpha);
	}

	static ALLEGRO_COLOR GetRandomColor(int aBrightness = 0)
	{
		int max = 255;
		int min = 0;

		if(aBrightness > 0)
		{
			min = 194;
		}
		else if(aBrightness < 0)
		{
			max = 64;
		}

		return al_map_rgb(randInt(min,max),randInt(min,max),randInt(min,max));
	}
};